import { type AppConfigVO } from '@/types/AppConfigType'
import { type R } from '@/types/R'
import { request } from '@/utils/Request'
import {defineStore} from 'pinia'
import {ref} from 'vue'
import { IsForce } from './CommonTypes'

export const useCommonStore =  defineStore('appCommonStore', ()=>{
    
    let appConfigVO = ref<AppConfigVO>()

    const initCommonStore = async()=>{
        let r:R<AppConfigVO> = await request.post("/app/appBase/getAppConfig")
        appConfigVO.value = r.data
    }

    return {appConfigVO, initCommonStore, }
},{
    persist: {
        storage: {
            getItem: uni.getStorageSync,
            setItem: uni.setStorageSync
        }
    }
})

